﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Blizzard.Contracts;
using Blizzard.Interceptors;

namespace Blizzard.Test.DataObjectsII
{
    [MapperAttribute(Table = "[DataObjectsII BBBB]")]
    public class BBBB : IDataObject
    {
        private Interceptor _interceptor;
        [MapperAttribute(Field = "[MY ID]", IsIdentityColumn = true)]
        public int Id { get; set; }

        private string _name;
        [Mapper(Field = "Name")]
        public string Name
        {
            get
            {
                _interceptor.Intercept(this, "Name", false);
                return _name;
            }
            set
            {
                _interceptor.Intercept(this, "Name", true, _name, value);
                _name = value;
            }
        }

        

        private string category;
        [Mapper(Field = "Category")]
        public string Category
        {
            get 
            {
                _interceptor.Intercept(this, "Category", false);
                return category; 
            }
            set 
            {
                _interceptor.Intercept(this, "Category", true, category, value);
                category = value; 
            }
        }



        

        private int code;
        [Mapper(Field = "Code")]
        public int Code
        {
            get 
            {
                _interceptor.Intercept(this, "Code", false);
                return code; 
            }
            set 
            {
                _interceptor.Intercept(this, "Code", true, code, value);
                code = value; 
            }
        }



        

        private DateTime dateCreated;
        [Mapper(Field = "DateCreated")]
        public DateTime DateCreated
        {
            get 
            {
                _interceptor.Intercept(this, "DateCreated", false);
                return dateCreated; 
            }
            set 
            {
                _interceptor.Intercept(this, "DateCreated", true, dateCreated, value);
                dateCreated = value; 
            }
        }




        private A _a;
        [Mapper(Field = "[A ID]", Composition = false)]
        public A a
        {
            get
            {
                _interceptor.Intercept(this, "a", false);
                return _a;
            }
            set
            {
                _interceptor.Intercept(this, "a", true, _a, value);
                _a = value;
            }
        }


        public Container.BlizzardManager Manager
        {
            set { _interceptor = new Interceptor(value); }
        }
    }
}
